package com.jytc.framework.po;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * FwUser entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "fw_user")
public class FwUser implements java.io.Serializable {

	// Fields

	private Integer userId;
	private String userCode;
	private String password;
	private String mobilePhone;
	private String userName;
	private Integer userType;
	private Integer deptId;
	private Integer systemType;
	private Integer status;
	private String validTag;
	private String validDate;
	private String email;
	private String userRemark;
	private String tel;
	private Set<FwUserRole> fwUserRoles = new HashSet<FwUserRole>(0);

	// Constructors

	/** default constructor */
	public FwUser() {
	}

	/** minimal constructor */
	public FwUser(String userCode, String password, String userName,
			Integer userType, Integer deptId, Integer systemType, Integer status) {
		this.userCode = userCode;
		this.password = password;
		this.userName = userName;
		this.userType = userType;
		this.deptId = deptId;
		this.systemType = systemType;
		this.status = status;
	}

	/** full constructor */
	public FwUser(String userCode, String password, String mobilePhone,
			String userName, Integer userType, Integer deptId,
			Integer systemType, Integer status, String validTag,
			String validDate, String email, String userRemark, String tel,
			Set<FwUserRole> fwUserRoles) {
		this.userCode = userCode;
		this.password = password;
		this.mobilePhone = mobilePhone;
		this.userName = userName;
		this.userType = userType;
		this.deptId = deptId;
		this.systemType = systemType;
		this.status = status;
		this.validTag = validTag;
		this.validDate = validDate;
		this.email = email;
		this.userRemark = userRemark;
		this.tel = tel;
		this.fwUserRoles = fwUserRoles;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "USER_ID", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "USER_CODE", nullable = false, length = 20)
	public String getUserCode() {
		return this.userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	@Column(name = "PASSWORD", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "MOBILE_PHONE", length = 21)
	public String getMobilePhone() {
		return this.mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	@Column(name = "USER_NAME", nullable = false, length = 20)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "USER_TYPE", nullable = false)
	public Integer getUserType() {
		return this.userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	@Column(name = "DEPT_ID", nullable = false)
	public Integer getDeptId() {
		return this.deptId;
	}

	public void setDeptId(Integer deptId) {
		this.deptId = deptId;
	}

	@Column(name = "SYSTEM_TYPE", nullable = false)
	public Integer getSystemType() {
		return this.systemType;
	}

	public void setSystemType(Integer systemType) {
		this.systemType = systemType;
	}

	@Column(name = "STATUS", nullable = false)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "VALID_TAG", length = 1)
	public String getValidTag() {
		return this.validTag;
	}

	public void setValidTag(String validTag) {
		this.validTag = validTag;
	}

	@Column(name = "VALID_DATE", length = 14)
	public String getValidDate() {
		return this.validDate;
	}

	public void setValidDate(String validDate) {
		this.validDate = validDate;
	}

	@Column(name = "EMAIL", length = 100)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "USER_REMARK", length = 200)
	public String getUserRemark() {
		return this.userRemark;
	}

	public void setUserRemark(String userRemark) {
		this.userRemark = userRemark;
	}

	@Column(name = "TEL", length = 21)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fwUser")
	public Set<FwUserRole> getFwUserRoles() {
		return this.fwUserRoles;
	}

	public void setFwUserRoles(Set<FwUserRole> fwUserRoles) {
		this.fwUserRoles = fwUserRoles;
	}

}